home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / cg / saveallpages.rexx < prev    next >
OS/2 REXX Batch file  |  1995-11-07  |  774b  |  40 lines

  1. /* SaveAllPages.rexx -- Saves a book as pages. */
  2. /* By Bob Caron © 1994 NewTek, Inc.            */
  3.  
  4. call addlib(CG_AREXX,0)
  5.  
  6. location=REQ_DIR("Save To Where?","Toaster:CG")
  7.  
  8. if exists(location)=0 then do
  9.    call REQ_TELL("Can't save to there...")
  10.    exit
  11.    end
  12.  
  13. if location="" then
  14.    exit
  15.  
  16. current_page=0
  17. call SET_PAGE(0)
  18.  
  19. do while current_page < 99
  20.    if ~page_is_blank() then do
  21.       call pragma(d,location)
  22.       call SAVEPAGE(location||"Page."current_page)
  23.       end
  24.    current_page=current_page+1
  25.    call SET_PAGE(NEXT)
  26.    end
  27.    call REQ_TELL("Saved...")
  28. call remlib(CG_AREXX)
  29. exit
  30.  
  31. /* SubRoutines */
  32.  
  33. page_is_blank:
  34.   page_size=GET_PAGE(SIZE)
  35.   line_size=GET_LINE(SIZE)
  36.   if (page_size = 0 | page_size = 1) & line_size = 0 then
  37.      return 1
  38.   else
  39.      return 0
  40.